<% @user.password = @user.password_confirmation = nil %>

<div id="user-signup">	
	<% form_for :user, :url => users_path, :html => {:class=>'uniForm'} do |f| -%>
		<fieldset class="inlineLabels">
			<h1>Sign up as a new user</h1>
			<%= error_messages_for :user %>
			<%= error_messages_for :group %>

			<div class="ctrlHolder">
				<label for="">Username</label>
				<%= f.text_field :login, :class=>'textInput' %>
				<p class="formHint">The username you will use to log in.</p>
			</div>

			<div class="ctrlHolder">
				<label for="">Name</label>
				<%= f.text_field :name, :class=>'textInput' %>
				<p class="formHint">Full name, please!</p>
			</div>

			<div class="ctrlHolder">
				<label for="">Email</label>
				<%= f.text_field :email, :class=>'textInput' %>
				<p class="formHint">We'll send you your activation code/important updates/nagging chore and expense reminders. Make sure this is right!</p>
			</div>

			<div class="ctrlHolder">
				<label for="">Password</label>
				<%= f.password_field :password, :class=>'textInput' %>
				<p class="formHint">Choose a secure password, you never know who will hack you to see what chores you have listed for this week.</p>
			</div>

			<div class="ctrlHolder">
				<label for="">Confirm Password</label>
				<%= f.password_field :password_confirmation, :class=>'textInput' %>
				<p class="formHint">One more time, for good luck.</p>
			</div>
			
			<div class="ctrlHolder">
				<p><%= radio_button("groupfields", "option", "existing", :checked => 'checked') %> I want to join an existing group.</p>
				<p><%= radio_button("groupfields", "option", "new") %> I don't have a group, let me create one.</p>
			</div>
			
			<div class="ctrlHolder">
				<label for="">Group</label>
				<div id='group-existing-chooser'>
					<%= select(:user, :group_id, Group.find(:all).collect{ |g| [g.name, g.id] }, :html=>{:class=>'selectInput'}) %>
					<p class="formHint">The group you wish to join. You must know the password.</p>
				</div>
				<div id='group-new-field'>
					<%= text_field :groupfields, :name, :class=>'textInput' %>
					<p class="formHint">Your unique group name.</p>
				</div>
				
			</div>
	  
			<div class="ctrlHolder">
				<label for="">Group Password</label>
				<%= f.text_field :group_password, :class=>'textInput' %>
				<p class="formHint" id='group-existing-password'>Ask Amber or your group leader what the password is.</p>
				<p class="formHint" id='group-new-password'>Create a password for your group and let all your group members know</p>
			</div>
	
			<div class="buttonHolder">
				<%= submit_tag 'Sign up' %>
			</div>
		</fieldset>
	<% end -%>
</div>